home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / limits.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  44.1 KB  |  1,014 lines

  1. #ifndef __STD_LIMITS
  2. #define __STD_LIMITS
  3. #pragma option push -b -a4 -Vx- -Ve- -w-inl -w-aus -w-sig
  4.  
  5. /***************************************************************************
  6.  *
  7.  * limits - Declarations for the Standard Library limits class
  8.  *
  9.  * $Id: limits,v 1.72 1996/09/24 19:17:20 smithey Exp $
  10.  *
  11.  ***************************************************************************
  12.  *
  13.  * (c) Copyright 1994, 1995 Rogue Wave Software, Inc.
  14.  * ALL RIGHTS RESERVED *
  15.  * The software and information contained herein are proprietary to, and
  16.  * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
  17.  * intends to preserve as trade secrets such software and information.
  18.  * This software is furnished pursuant to a written license agreement and
  19.  * may be used, copied, transmitted, and stored only in accordance with
  20.  * the terms of such license and with the inclusion of the above copyright
  21.  * notice.  This software and information or any other copies thereof may
  22.  * not be provided or otherwise made available to any other person.
  23.  *
  24.  * Notwithstanding any other lease or license that may pertain to, or
  25.  * accompany the delivery of, this computer software and information, the
  26.  * rights of the Government regarding its use, reproduction and disclosure
  27.  * are as set forth in Section 52.227-19 of the FARS Computer
  28.  * Software-Restricted Rights clause.
  29.  * 
  30.  * Use, duplication, or disclosure by the Government is subject to
  31.  * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
  32.  * Technical Data and Computer Software clause at DFARS 252.227-7013.
  33.  * Contractor/Manufacturer is Rogue Wave Software, Inc.,
  34.  * P.O. Box 2328, Corvallis, Oregon 97339.
  35.  *
  36.  * This computer software and information is distributed with "restricted
  37.  * rights."  Use, duplication or disclosure is subject to restrictions as
  38.  * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
  39.  * Computer Software-Restricted Rights (April 1985)."  If the Clause at
  40.  * 18-52.227-74 "Rights in Data General" is specified in the contract,
  41.  * then the "Alternate III" clause applies.
  42.  *
  43.  **************************************************************************/
  44.  
  45. #include <stdcomp.h>
  46. #include <rw/stddefs.h>
  47. #include <rw/math.h>
  48.  
  49. #ifndef _RWSTD_NO_NEW_HEADER
  50. #include <cfloat>
  51. #include <climits>
  52. #ifdef _RWSTD_REQUIRES_IEEEFP
  53. #include <ieeefp.h>    // for siemens
  54. #endif
  55. #else
  56. #include <float.h>
  57. #ifdef _RWSTD_REQUIRES_IEEEFP
  58. #include <ieeefp.h>    // for siemens
  59. #endif
  60. #include <limits.h>
  61. #endif
  62.  
  63. //
  64. // Turn off the warnings under the MSVC compiler that
  65. // say 'bool reserved for future use'
  66. //
  67. #ifdef _RWSTD_MSVC_BOOL_WARNING
  68. #pragma warning ( disable : 4237 )
  69. #endif
  70.  
  71.  
  72. #ifndef _RWSTD_NO_NAMESPACE
  73. namespace std {
  74. #endif
  75.  
  76. #if defined(__OS2__) || defined(__MFC_COMPAT__)
  77. #  ifdef max
  78. #     undef max
  79. #  endif
  80. #  ifdef min
  81. #     undef min
  82. #  endif
  83. #endif /*__OS2__ || __MFC_COMPAT__*/
  84.  
  85. enum float_round_style
  86. {
  87.     round_indeterminable      = -1,
  88.     round_toward_zero         =  0,
  89.     round_to_nearest          =  1,
  90.     round_toward_infinity     =  2,
  91.     round_toward_neg_infinity =  3
  92. };
  93.  
  94. #if !defined(_RWSTD_NO_STI_SIMPLE) && defined(_RWSTD_FLT_ROUNDS_IS_CONSTANT)
  95. #define __RW_INIT(n) = n
  96. #else
  97. #define __RW_INIT(n) /**/
  98. #endif
  99.  
  100.  
  101.  
  102. //**********************************************************************
  103. //
  104. // Assumptions made in this implementation:
  105. //
  106. //   1) numeric_limits<int>::radix equals numeric_limits<T>::radix
  107. //      for all integral T specialized in this file.
  108. //
  109. //   2) numeric_limits<int>::is_modulo equals numeric_limits<T>::is_modulo
  110. //      for all signed integral T specialized in this file, except
  111. //      numeric_limits<bool>::is_modulo, which is assumed to be false.
  112. //
  113. //   3) numeric_limts<T>::traps == false for all builtin integral T.
  114. //
  115. // Does there exist a machine for which these aren't true?
  116. //
  117. //**********************************************************************
  118.  
  119.  
  120. //**********************************************************************
  121. //
  122. // If your compiler allows in-class initialization of static const data
  123. // members of integral type, then look for all lines having a comment of
  124. // the form
  125. //
  126. //       // VENDOR
  127. //
  128. // and set the value on that line to the proper one for your environment.
  129. //
  130. // If your compiler does NOT allow in-class initialization of static const
  131. // data members of integral type, then you'll need to set the values in
  132. // stdlib/src/limits/limits.cpp so they're properly archived into the
  133. // Standard Library.
  134. //
  135. //**********************************************************************
  136. template <class T>
  137. class _RWSTDExportTemplate numeric_limits;
  138.  
  139. //
  140. // Specialization for float.
  141. //
  142. /*
  143. #ifdef macintosh
  144. # define FLT_MIN 1.17549E-38
  145. # define FLT_MAX 3.40282E+38
  146. # define FLT_MANT_DIG 24
  147. # define FLT_DIG 6
  148. #endif
  149. */
  150.  
  151. _RWSTD_TEMPLATE
  152. class _RWSTDExport numeric_limits<float>
  153. {
  154.   public:
  155.  
  156.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  157.  
  158.     static inline float min ()  _RWSTD_INLINE_NO_THROW { return FLT_MIN; }
  159.     static inline float max ()  _RWSTD_INLINE_NO_THROW { return FLT_MAX; }
  160.  
  161.     static const _RWSTDExportTemplate int digits   __RW_INIT(FLT_MANT_DIG);
  162.     static const _RWSTDExportTemplate int digits10 __RW_INIT(FLT_DIG);
  163.  
  164.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(true);
  165.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(false);
  166.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(false);
  167.  
  168.     static const  int _RWSTDExportTemplate radix __RW_INIT(FLT_RADIX);
  169.  
  170.     static inline float epsilon () _RWSTD_INLINE_NO_THROW { return FLT_EPSILON; }
  171.     static float _RWSTDExportTemplate round_error    () _RWSTD_INLINE_NO_THROW;
  172.  
  173.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(FLT_MIN_EXP);
  174.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(FLT_MIN_10_EXP);
  175.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(FLT_MAX_EXP);
  176.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(FLT_MAX_10_EXP);
  177.  
  178.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);            // VENDOR
  179.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);            // VENDOR
  180.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);            // VENDOR
  181.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);            // VENDOR
  182.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);            // VENDOR
  183.  
  184.     static float infinity      () _RWSTD_INLINE_NO_THROW;
  185.     static float quiet_NaN     () _RWSTD_INLINE_NO_THROW;
  186.     static float signaling_NaN () _RWSTD_INLINE_NO_THROW;
  187.     static float denorm_min    () _RWSTD_INLINE_NO_THROW;
  188.  
  189.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);                   // VENDOR
  190.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  191.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(false);                   // VENDOR
  192.  
  193.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);              // VENDOR
  194.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);              // VENDOR
  195.  
  196.   static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(_RWSTD_STATIC_CAST(float_round_style,FLT_ROUNDS));
  197. };
  198.  
  199. //
  200. // Specialization for double.
  201. //
  202.  
  203. _RWSTD_TEMPLATE
  204. class _RWSTDExport numeric_limits<double>
  205. {
  206.   public:
  207.  
  208.     static const bool _RWSTDExportTemplate is_specialized  __RW_INIT(true);
  209.  
  210.     static inline double min ()  _RWSTD_INLINE_NO_THROW { return DBL_MIN; }
  211.     static inline double max ()  _RWSTD_INLINE_NO_THROW { return DBL_MAX; }
  212.  
  213.     static const int _RWSTDExportTemplate digits   __RW_INIT(DBL_MANT_DIG);
  214.     static const int _RWSTDExportTemplate digits10 __RW_INIT(DBL_DIG);
  215.  
  216.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(true);
  217.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(false);
  218.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(false);
  219.  
  220.     static const int _RWSTDExportTemplate radix __RW_INIT(FLT_RADIX);
  221.  
  222.     static inline double epsilon () _RWSTD_INLINE_NO_THROW { return DBL_EPSILON; }
  223.     static double round_error    () _RWSTD_INLINE_NO_THROW;
  224.  
  225.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(DBL_MIN_EXP);
  226.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(DBL_MIN_10_EXP);
  227.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(DBL_MAX_EXP);
  228.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(DBL_MAX_10_EXP);
  229.  
  230.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);            // VENDOR
  231.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);            // VENDOR
  232.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);            // VENDOR
  233.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);            // VENDOR
  234.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);            // VENDOR
  235.  
  236.     static double infinity      () _RWSTD_INLINE_NO_THROW;
  237.     static double quiet_NaN     () _RWSTD_INLINE_NO_THROW;
  238.     static double signaling_NaN () _RWSTD_INLINE_NO_THROW;
  239.     static double denorm_min    () _RWSTD_INLINE_NO_THROW;
  240.  
  241.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);                   // VENDOR
  242.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  243.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(false);                   // VENDOR
  244.  
  245.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);              // VENDOR
  246.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);              // VENDOR
  247.  
  248.   static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(_RWSTD_STATIC_CAST(float_round_style,FLT_ROUNDS));
  249. };
  250.  
  251. //
  252. // Specialization for long double.
  253. //
  254.  
  255. #ifndef _RWSTD_NO_LONGDOUBLE
  256.  
  257. _RWSTD_TEMPLATE
  258. class _RWSTDExport numeric_limits<long double>
  259. {
  260.   public:
  261.  
  262.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  263.  
  264.     static inline long double min () _RWSTD_INLINE_NO_THROW { return LDBL_MIN; } 
  265.     static inline long double max () _RWSTD_INLINE_NO_THROW { return LDBL_MAX; }
  266.  
  267.     static const int _RWSTDExportTemplate digits   __RW_INIT(LDBL_MANT_DIG);
  268.     static const int _RWSTDExportTemplate digits10 __RW_INIT(LDBL_DIG);
  269.  
  270.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(true);
  271.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(false);
  272.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(false);
  273.  
  274.     static const int _RWSTDExportTemplate radix __RW_INIT(FLT_RADIX);
  275.  
  276.     static inline long double epsilon () _RWSTD_INLINE_NO_THROW { return LDBL_EPSILON; }
  277.     static long double round_error    () _RWSTD_INLINE_NO_THROW;
  278.  
  279.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(LDBL_MIN_EXP);
  280.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(LDBL_MIN_10_EXP);
  281.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(LDBL_MAX_EXP);
  282.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(LDBL_MAX_10_EXP);
  283.  
  284.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);            // VENDOR
  285.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);            // VENDOR
  286.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);            // VENDOR
  287.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);            // VENDOR
  288.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);            // VENDOR
  289.  
  290.     static long double _RWSTDExportTemplate infinity      () _RWSTD_INLINE_NO_THROW;
  291.     static long double _RWSTDExportTemplate quiet_NaN     () _RWSTD_INLINE_NO_THROW;
  292.     static long double _RWSTDExportTemplate signaling_NaN () _RWSTD_INLINE_NO_THROW;
  293.     static long double _RWSTDExportTemplate denorm_min    () _RWSTD_INLINE_NO_THROW;
  294.  
  295.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);                   // VENDOR
  296.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  297.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(false);                   // VENDOR
  298.  
  299.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);              // VENDOR
  300.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);              // VENDOR
  301.  
  302.   static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(_RWSTD_STATIC_CAST(float_round_style,FLT_ROUNDS));
  303. };
  304. #endif /* _RWSTD_NO_LONGDOUBLE */
  305.  
  306. //
  307. // Specialization for int.
  308. //
  309.  
  310. _RWSTD_TEMPLATE
  311. class _RWSTDExport numeric_limits<int>
  312. {
  313.   public:
  314.  
  315.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  316.  
  317.     static inline int min ()  _RWSTD_INLINE_NO_THROW { return INT_MIN; }
  318.     static inline int max ()  _RWSTD_INLINE_NO_THROW { return INT_MAX; }
  319.  
  320.     static const int _RWSTDExportTemplate digits   __RW_INIT(CHAR_BIT*sizeof(int)-1);
  321.     static const int _RWSTDExportTemplate digits10 __RW_INIT(int(digits/3.321928095));
  322.  
  323.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(true);
  324.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(true);
  325.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(true);
  326.  
  327.     static const int _RWSTDExportTemplate radix __RW_INIT(2);                             // VENDOR
  328.  
  329.     static inline int epsilon     () _RWSTD_INLINE_NO_THROW { return 0; }
  330.     static inline int round_error () _RWSTD_INLINE_NO_THROW { return 0; }
  331.  
  332.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(0);
  333.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(0);
  334.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(0);
  335.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(0);
  336.  
  337.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);
  338.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);
  339.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);
  340.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);
  341.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);
  342.  
  343.     static inline int _RWSTDExportTemplate infinity      () _RWSTD_INLINE_NO_THROW { return 0;     }
  344.     static inline int _RWSTDExportTemplate quiet_NaN     () _RWSTD_INLINE_NO_THROW { return 0;     }
  345.     static inline int _RWSTDExportTemplate signaling_NaN () _RWSTD_INLINE_NO_THROW { return 0;     }
  346.     static inline int _RWSTDExportTemplate denorm_min    () _RWSTD_INLINE_NO_THROW { return min(); }
  347.  
  348.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);
  349.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  350.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(false);                   // VENDOR
  351.  
  352.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);
  353.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);
  354.  
  355.     static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(round_toward_zero); 
  356. };
  357.  
  358. #ifndef _RWSTD_NO_OVERLOAD_WCHAR
  359.  
  360. _RWSTD_TEMPLATE
  361. class _RWSTDExport numeric_limits<wchar_t>
  362. {
  363.   public:
  364.  
  365.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  366.  
  367.     static wchar_t min () _RWSTD_INLINE_NO_THROW;
  368.     static wchar_t max () _RWSTD_INLINE_NO_THROW;
  369.  
  370.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(true);                    // VENDOR
  371.  
  372.     static const int _RWSTDExportTemplate digits   __RW_INIT(is_signed ? CHAR_BIT*sizeof(wchar_t) - 1 : CHAR_BIT*sizeof(wchar_t));
  373.     static const int _RWSTDExportTemplate digits10 __RW_INIT(int(digits/3.321928095));
  374.  
  375.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(true);
  376.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(true);
  377.  
  378.     static const int _RWSTDExportTemplate radix __RW_INIT(numeric_limits<int>::radix);
  379.  
  380.     static inline wchar_t epsilon     () _RWSTD_INLINE_NO_THROW { return 0; }
  381.     static inline wchar_t round_error () _RWSTD_INLINE_NO_THROW { return 0; }
  382.  
  383.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(0);
  384.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(0);
  385.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(0);
  386.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(0);
  387.  
  388.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);
  389.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);
  390.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);
  391.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);
  392.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);
  393.  
  394.     static inline wchar_t _RWSTDExportTemplate infinity      () _RWSTD_INLINE_NO_THROW { return 0;     }
  395.     static inline wchar_t _RWSTDExportTemplate quiet_NaN     () _RWSTD_INLINE_NO_THROW { return 0;     }
  396.     static inline wchar_t _RWSTDExportTemplate signaling_NaN () _RWSTD_INLINE_NO_THROW { return 0;     }
  397.     static inline wchar_t _RWSTDExportTemplate denorm_min    () _RWSTD_INLINE_NO_THROW { return min(); }
  398.  
  399.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);
  400.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  401.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(is_signed ? numeric_limits<int>::is_modulo : true);
  402.  
  403.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);
  404.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);
  405.  
  406.     static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(round_toward_zero);
  407. };
  408. #endif /*!_RWSTD_NO_OVERLOAD_WCHAR*/
  409.  
  410. //**********************************************************************
  411. //
  412. // There are no VENDOR-settable values beyond this point.
  413. //
  414. //**********************************************************************
  415.  
  416. //
  417. // Specialization for short.
  418. //
  419.  
  420. _RWSTD_TEMPLATE
  421. class _RWSTDExport numeric_limits<short>
  422. {
  423.   public:
  424.  
  425.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  426.  
  427.     static inline short min ()  _RWSTD_INLINE_NO_THROW { return SHRT_MIN; }
  428.     static inline short max ()  _RWSTD_INLINE_NO_THROW { return SHRT_MAX; }
  429.  
  430.     static const int _RWSTDExportTemplate digits   __RW_INIT(CHAR_BIT*sizeof(short)-1);
  431.     static const int _RWSTDExportTemplate digits10 __RW_INIT(int(digits/3.321928095));
  432.  
  433.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(true);
  434.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(true);
  435.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(true);
  436.  
  437.     static const int _RWSTDExportTemplate radix __RW_INIT(numeric_limits<int>::radix);
  438.  
  439.     static inline short epsilon     () _RWSTD_INLINE_NO_THROW { return 0; }
  440.     static inline short round_error () _RWSTD_INLINE_NO_THROW { return 0; }
  441.  
  442.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(0);
  443.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(0);
  444.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(0);
  445.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(0);
  446.  
  447.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);
  448.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);
  449.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);
  450.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);
  451.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);
  452.  
  453.  
  454.     static inline short _RWSTDExportTemplate infinity      () _RWSTD_INLINE_NO_THROW { return 0;     }
  455.     static inline short _RWSTDExportTemplate quiet_NaN     () _RWSTD_INLINE_NO_THROW { return 0;     } 
  456.     static inline short _RWSTDExportTemplate signaling_NaN () _RWSTD_INLINE_NO_THROW { return 0;     }
  457.     static inline short _RWSTDExportTemplate denorm_min    () _RWSTD_INLINE_NO_THROW { return min(); }
  458.  
  459.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);
  460.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  461.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(numeric_limits<int>::is_modulo);
  462.  
  463.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);
  464.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);
  465.  
  466.     static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(round_toward_zero);
  467. };
  468.  
  469. //
  470. // Specialization for unsigned short.
  471. //
  472.  
  473. _RWSTD_TEMPLATE
  474. class _RWSTDExport numeric_limits<unsigned short>
  475. {
  476.   public:
  477.  
  478.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  479.  
  480.     static inline unsigned short min ()  _RWSTD_INLINE_NO_THROW { return 0;         }
  481.     static inline unsigned short max ()  _RWSTD_INLINE_NO_THROW { return USHRT_MAX; }
  482.  
  483.     static const int _RWSTDExportTemplate digits   __RW_INIT(CHAR_BIT*sizeof(unsigned short));
  484.     static const int _RWSTDExportTemplate digits10 __RW_INIT(int(digits/3.321928095));
  485.  
  486.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(false);
  487.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(true);
  488.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(true);
  489.  
  490.     static const int _RWSTDExportTemplate radix __RW_INIT(numeric_limits<int>::radix);
  491.  
  492.     static inline unsigned short epsilon     () _RWSTD_INLINE_NO_THROW { return 0; }
  493.     static inline unsigned short round_error () _RWSTD_INLINE_NO_THROW { return 0; }
  494.  
  495.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(0);
  496.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(0);
  497.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(0);
  498.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(0);
  499.  
  500.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);
  501.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);
  502.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);
  503.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);
  504.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);
  505.  
  506.     static inline unsigned short infinity      () _RWSTD_INLINE_NO_THROW { return 0;     }
  507.     static inline unsigned short quiet_NaN     () _RWSTD_INLINE_NO_THROW { return 0;     }
  508.     static inline unsigned short signaling_NaN () _RWSTD_INLINE_NO_THROW { return 0;     }
  509.     static inline unsigned short denorm_min    () _RWSTD_INLINE_NO_THROW { return min(); }
  510.  
  511.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);
  512.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  513.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(true);
  514.  
  515.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);
  516.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);
  517.  
  518.     static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(round_toward_zero);
  519. };
  520.  
  521. //
  522. // Specialization for unsigned int.
  523. //
  524.  
  525. _RWSTD_TEMPLATE
  526. class _RWSTDExport numeric_limits<unsigned int>
  527. {
  528.   public:
  529.  
  530.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  531.  
  532.     static inline unsigned int min ()  _RWSTD_INLINE_NO_THROW { return 0;        }
  533.     static inline unsigned int max ()  _RWSTD_INLINE_NO_THROW { return UINT_MAX; }
  534.  
  535.     static const int _RWSTDExportTemplate digits   __RW_INIT(CHAR_BIT*sizeof(unsigned int));
  536.     static const int _RWSTDExportTemplate digits10 __RW_INIT(int(digits/3.321928095));
  537.  
  538.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(false);
  539.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(true);
  540.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(true);
  541.  
  542.     static const int _RWSTDExportTemplate radix __RW_INIT(numeric_limits<int>::radix);
  543.  
  544.     static inline unsigned int epsilon     () _RWSTD_INLINE_NO_THROW { return 0; }
  545.     static inline unsigned int round_error () _RWSTD_INLINE_NO_THROW { return 0; }
  546.  
  547.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(0);
  548.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(0);
  549.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(0);
  550.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(0);
  551.  
  552.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);
  553.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);
  554.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);
  555.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);
  556.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);
  557.  
  558.     static inline unsigned int infinity      () _RWSTD_INLINE_NO_THROW { return 0;     }
  559.     static inline unsigned int quiet_NaN     () _RWSTD_INLINE_NO_THROW { return 0;     }
  560.     static inline unsigned int signaling_NaN () _RWSTD_INLINE_NO_THROW { return 0;     }
  561.     static inline unsigned int denorm_min    () _RWSTD_INLINE_NO_THROW { return min(); }
  562.  
  563.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);
  564.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  565.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(true);
  566.  
  567.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);
  568.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);
  569.  
  570.     static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(round_toward_zero);
  571. };
  572.  
  573. //
  574. // Specialization for long.
  575. //
  576.  
  577. _RWSTD_TEMPLATE
  578. class _RWSTDExport numeric_limits<long>
  579. {
  580.   public:
  581.  
  582.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  583.  
  584.     static inline long min ()  _RWSTD_INLINE_NO_THROW { return LONG_MIN; }
  585.     static inline long max ()  _RWSTD_INLINE_NO_THROW { return LONG_MAX; }
  586.  
  587.     static const int _RWSTDExportTemplate digits   __RW_INIT(CHAR_BIT*sizeof(long)-1);
  588.     static const int _RWSTDExportTemplate digits10 __RW_INIT(int(digits/3.321928095));
  589.  
  590.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(true);
  591.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(true);
  592.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(true);
  593.  
  594.     static const int _RWSTDExportTemplate radix __RW_INIT(numeric_limits<int>::radix);
  595.  
  596.     static inline long epsilon     () _RWSTD_INLINE_NO_THROW { return 0; }
  597.     static inline long round_error () _RWSTD_INLINE_NO_THROW { return 0; }
  598.  
  599.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(0);
  600.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(0); 
  601.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(0);
  602.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(0);
  603.  
  604.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);
  605.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);
  606.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);
  607.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);
  608.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);
  609.  
  610.     static inline long infinity      () _RWSTD_INLINE_NO_THROW { return 0;     }
  611.     static inline long quiet_NaN     () _RWSTD_INLINE_NO_THROW { return 0;     }
  612.     static inline long signaling_NaN () _RWSTD_INLINE_NO_THROW { return 0;     }
  613.     static inline long denorm_min    () _RWSTD_INLINE_NO_THROW { return min(); }
  614.  
  615.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);
  616.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  617.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(numeric_limits<int>::is_modulo);
  618.  
  619.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);
  620.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);
  621.  
  622.     static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(round_toward_zero);
  623. };
  624.  
  625. //
  626. // Specialization for unsigned long.
  627. //
  628.  
  629. _RWSTD_TEMPLATE
  630. class _RWSTDExport numeric_limits<unsigned long>
  631. {
  632.   public:
  633.  
  634.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  635.  
  636.     static inline unsigned long min ()  _RWSTD_INLINE_NO_THROW { return 0;         }
  637.     static inline unsigned long max ()  _RWSTD_INLINE_NO_THROW { return ULONG_MAX; }
  638.  
  639.     static const int _RWSTDExportTemplate digits   __RW_INIT(CHAR_BIT*sizeof(unsigned long));
  640.     static const int _RWSTDExportTemplate digits10 __RW_INIT(int(digits/3.321928095));
  641.  
  642.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(false);
  643.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(true);
  644.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(true);
  645.  
  646.     static const int _RWSTDExportTemplate radix __RW_INIT(numeric_limits<int>::radix);
  647.  
  648.     static inline unsigned long epsilon     () _RWSTD_INLINE_NO_THROW { return 0; }
  649.     static inline unsigned long round_error () _RWSTD_INLINE_NO_THROW { return 0; }
  650.  
  651.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(0);
  652.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(0); 
  653.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(0);
  654.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(0);
  655.  
  656.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);
  657.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);
  658.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);
  659.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);
  660.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);
  661.  
  662.     static inline unsigned long infinity      () _RWSTD_INLINE_NO_THROW { return 0;     }
  663.     static inline unsigned long quiet_NaN     () _RWSTD_INLINE_NO_THROW { return 0;     }
  664.     static inline unsigned long signaling_NaN () _RWSTD_INLINE_NO_THROW { return 0;     }
  665.     static inline unsigned long denorm_min    () _RWSTD_INLINE_NO_THROW { return min(); }
  666.  
  667.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);
  668.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  669.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(true);
  670.  
  671.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);
  672.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);
  673.  
  674.     static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(round_toward_zero);
  675. };
  676.  
  677. //
  678. // Specialization for char.
  679. //
  680.  
  681. _RWSTD_TEMPLATE
  682. class _RWSTDExport numeric_limits<char>
  683. {
  684.   public:
  685.  
  686.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  687.  
  688.     static inline char min ()  _RWSTD_INLINE_NO_THROW { return CHAR_MIN; }
  689.     static inline char max ()  _RWSTD_INLINE_NO_THROW { return CHAR_MAX; }
  690.  
  691.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(CHAR_MAX == SCHAR_MAX ? true : false);
  692.  
  693.     static const int _RWSTDExportTemplate digits   __RW_INIT(is_signed ? CHAR_BIT*sizeof(char) -1 : CHAR_BIT*sizeof(char));
  694.     static const int _RWSTDExportTemplate digits10 __RW_INIT(int(digits/3.321928095));
  695.  
  696.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(true);
  697.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(true);
  698.  
  699.     static const int _RWSTDExportTemplate radix __RW_INIT(numeric_limits<int>::radix);
  700.  
  701.     static inline char epsilon     () _RWSTD_INLINE_NO_THROW { return 0; }
  702.     static inline char round_error () _RWSTD_INLINE_NO_THROW { return 0; }
  703.  
  704.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(0);
  705.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(0); 
  706.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(0);
  707.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(0);
  708.  
  709.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);
  710.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);
  711.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);
  712.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);
  713.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);
  714.  
  715.     static inline char infinity      () _RWSTD_INLINE_NO_THROW { return 0;     }
  716.     static inline char quiet_NaN     () _RWSTD_INLINE_NO_THROW { return 0;     }
  717.     static inline char signaling_NaN () _RWSTD_INLINE_NO_THROW { return 0;     }
  718.     static inline char denorm_min    () _RWSTD_INLINE_NO_THROW { return min(); }
  719.     
  720.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);
  721.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  722.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(is_signed ? numeric_limits<int>::is_modulo : true);
  723.  
  724.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);
  725.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);
  726.  
  727.     static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(round_toward_zero);
  728. };
  729.  
  730. //
  731. // Specialization for unsigned char.
  732. //
  733.  
  734. _RWSTD_TEMPLATE
  735. class _RWSTDExport numeric_limits<unsigned char>
  736. {
  737.   public:
  738.  
  739.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  740.  
  741.     static inline unsigned char min ()  _RWSTD_INLINE_NO_THROW { return 0;         }
  742.     static inline unsigned char max ()  _RWSTD_INLINE_NO_THROW { return UCHAR_MAX; }
  743.  
  744.     static const int _RWSTDExportTemplate digits   __RW_INIT(CHAR_BIT*sizeof(unsigned char));
  745.     static const int _RWSTDExportTemplate digits10 __RW_INIT(int(digits/3.321928095)); 
  746.  
  747.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(false);
  748.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(true);
  749.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(true);
  750.  
  751.     static const int _RWSTDExportTemplate radix __RW_INIT(numeric_limits<int>::radix);
  752.  
  753.     static inline unsigned char epsilon     () _RWSTD_INLINE_NO_THROW { return 0; }
  754.     static inline unsigned char round_error () _RWSTD_INLINE_NO_THROW { return 0; }
  755.  
  756.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(0);
  757.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(0); 
  758.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(0);
  759.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(0);
  760.  
  761.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);
  762.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);
  763.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);
  764.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);
  765.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);
  766.  
  767.     static inline unsigned char infinity      () _RWSTD_INLINE_NO_THROW { return 0;     }
  768.     static inline unsigned char quiet_NaN     () _RWSTD_INLINE_NO_THROW { return 0;     }
  769.     static inline unsigned char signaling_NaN () _RWSTD_INLINE_NO_THROW { return 0;     }
  770.     static inline unsigned char denorm_min    () _RWSTD_INLINE_NO_THROW { return min(); }
  771.  
  772.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);
  773.     static const bool _RWSTDExportTemplate _RWSTDExportTemplate is_bounded __RW_INIT(true);
  774.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(true);
  775.  
  776.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);
  777.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);
  778.  
  779.     static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(round_toward_zero);
  780. };
  781.  
  782. //
  783. // Specialization for signed char.
  784. //
  785.  
  786. _RWSTD_TEMPLATE
  787. class _RWSTDExport numeric_limits<signed char>
  788. {
  789.   public:
  790.  
  791.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  792.  
  793.     static inline signed char min ()  _RWSTD_INLINE_NO_THROW { return SCHAR_MIN; }
  794.     static inline signed char max ()  _RWSTD_INLINE_NO_THROW { return SCHAR_MAX; }
  795.  
  796.     static const _RWSTDExportTemplate int digits   __RW_INIT(CHAR_BIT*sizeof(signed char)-1);
  797.     static const _RWSTDExportTemplate int digits10 __RW_INIT(int(digits/3.321928095));
  798.  
  799.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(true);
  800.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(true);
  801.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(true);
  802.  
  803.     static const int _RWSTDExportTemplate radix __RW_INIT(numeric_limits<int>::radix);
  804.  
  805.     static inline signed char epsilon     () _RWSTD_INLINE_NO_THROW { return 0; }
  806.     static inline signed char round_error () _RWSTD_INLINE_NO_THROW { return 0; }
  807.  
  808.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(0);
  809.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(0); 
  810.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(0);
  811.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(0);
  812.  
  813.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);
  814.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);
  815.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);
  816.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);
  817.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);
  818.  
  819.     static inline signed char infinity      () _RWSTD_INLINE_NO_THROW { return 0;     }
  820.     static inline signed char quiet_NaN     () _RWSTD_INLINE_NO_THROW { return 0;     }
  821.     static inline signed char signaling_NaN () _RWSTD_INLINE_NO_THROW { return 0;     }
  822.     static inline signed char denorm_min    () _RWSTD_INLINE_NO_THROW { return min(); }
  823.  
  824.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);
  825.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  826.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(numeric_limits<int>::is_modulo);
  827.  
  828.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);
  829.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);
  830.  
  831.     static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(round_toward_zero);
  832. };
  833.  
  834. #ifndef _RWSTD_NO_BOOL
  835. //
  836. // Specialization for bool.
  837. //
  838.  
  839. _RWSTD_TEMPLATE
  840. class _RWSTDExport numeric_limits<bool>
  841. {
  842.   public:
  843.  
  844.     static const bool _RWSTDExportTemplate is_specialized __RW_INIT(true);
  845.  
  846.     static inline bool min ()  _RWSTD_INLINE_NO_THROW { return false; }
  847.     static inline bool max ()  _RWSTD_INLINE_NO_THROW { return true;  }
  848.  
  849.     static const _RWSTDExportTemplate int digits   __RW_INIT(1);
  850.     static const _RWSTDExportTemplate int digits10 __RW_INIT(0);
  851.  
  852.     static const bool _RWSTDExportTemplate is_signed  __RW_INIT(false);
  853.     static const bool _RWSTDExportTemplate is_integer __RW_INIT(true);
  854.     static const bool _RWSTDExportTemplate is_exact   __RW_INIT(true);
  855.  
  856.     static const int _RWSTDExportTemplate radix __RW_INIT(numeric_limits<int>::radix);
  857.  
  858.     static inline bool epsilon     () _RWSTD_INLINE_NO_THROW { return 0; }
  859.     static inline bool round_error () _RWSTD_INLINE_NO_THROW { return 0; }
  860.  
  861.     static const int _RWSTDExportTemplate min_exponent   __RW_INIT(0);
  862.     static const int _RWSTDExportTemplate min_exponent10 __RW_INIT(0); 
  863.     static const int _RWSTDExportTemplate max_exponent   __RW_INIT(0);
  864.     static const int _RWSTDExportTemplate max_exponent10 __RW_INIT(0);
  865.  
  866.     static const bool _RWSTDExportTemplate has_infinity      __RW_INIT(false);
  867.     static const bool _RWSTDExportTemplate has_quiet_NaN     __RW_INIT(false);
  868.     static const bool _RWSTDExportTemplate has_signaling_NaN __RW_INIT(false);
  869.     static const bool _RWSTDExportTemplate has_denorm        __RW_INIT(false);
  870.     static const bool _RWSTDExportTemplate has_denorm_loss   __RW_INIT(false);
  871.  
  872.     static inline int infinity      () _RWSTD_INLINE_NO_THROW { return 0;     }
  873.     static inline int quiet_NaN     () _RWSTD_INLINE_NO_THROW { return 0;     }
  874.     static inline int signaling_NaN () _RWSTD_INLINE_NO_THROW { return 0;     }
  875.     static inline int denorm_min    () _RWSTD_INLINE_NO_THROW { return min(); }
  876.  
  877.     static const bool _RWSTDExportTemplate is_iec559  __RW_INIT(false);
  878.     static const bool _RWSTDExportTemplate is_bounded __RW_INIT(true);
  879.     static const bool _RWSTDExportTemplate is_modulo  __RW_INIT(false);
  880.  
  881.     static const bool _RWSTDExportTemplate traps           __RW_INIT(false);
  882.     static const bool _RWSTDExportTemplate tinyness_before __RW_INIT(false);
  883.  
  884.     static const float_round_style _RWSTDExportTemplate round_style __RW_INIT(round_toward_zero);
  885. };
  886. #endif /*!_RWSTD_NO_BOOL*/
  887.  
  888.  
  889.  
  890. template <class T>
  891. class _RWSTDExportTemplate numeric_limits
  892. {
  893.   public:
  894.  
  895.     static const bool is_specialized;
  896.  
  897.   static inline T min () _RWSTD_INLINE_NO_THROW { return _RWSTD_STATIC_CAST(T,0); }
  898.   static inline T max () _RWSTD_INLINE_NO_THROW { return _RWSTD_STATIC_CAST(T,0); }
  899.  
  900.     static const int digits;
  901.     static const int digits10;
  902.  
  903.     static const bool is_signed;
  904.     static const bool is_integer;
  905.     static const bool is_exact;
  906.  
  907.     static const int radix;
  908.     static inline T  epsilon     () _RWSTD_INLINE_NO_THROW { return _RWSTD_STATIC_CAST(T,0); }
  909.     static inline T  round_error () _RWSTD_INLINE_NO_THROW { return _RWSTD_STATIC_CAST(T,0); }
  910.  
  911.     static const int min_exponent;
  912.     static const int min_exponent10; 
  913.     static const int max_exponent;
  914.     static const int max_exponent10;
  915.  
  916.     static const bool has_infinity;
  917.     static const bool has_quiet_NaN;
  918.     static const bool has_signaling_NaN;
  919.     static const bool has_denorm;
  920.     static const bool has_denorm_loss;
  921.  
  922.     static inline T infinity      () _RWSTD_INLINE_NO_THROW { return _RWSTD_STATIC_CAST(T,0); }
  923.     static inline T quiet_NaN     () _RWSTD_INLINE_NO_THROW { return _RWSTD_STATIC_CAST(T,0); }
  924.     static inline T signaling_NaN () _RWSTD_INLINE_NO_THROW { return _RWSTD_STATIC_CAST(T,0); }
  925.  
  926.   static inline T denorm_min    () _RWSTD_INLINE_NO_THROW { return min(); }
  927.  
  928.     static const bool is_iec559;
  929.     static const bool is_bounded;
  930.     static const bool is_modulo;
  931.  
  932.     static const bool traps;
  933.     static const bool tinyness_before;
  934.  
  935.     static const float_round_style round_style;
  936. };
  937.  
  938. #ifndef _RWSTD_NO_TEMPLATE_SPECIALIZATION  
  939. template <class T>
  940. const bool numeric_limits<T>::is_specialized = false;
  941.  
  942. template <class T>
  943. const int numeric_limits<T>::digits = 0;
  944.  
  945. template <class T>
  946. const int numeric_limits<T>::digits10 = 0;
  947.  
  948. template <class T>
  949. const bool numeric_limits<T>::is_signed = false;
  950.  
  951. template <class T>
  952. const bool numeric_limits<T>::is_integer = false;
  953.  
  954. template <class T>
  955. const bool numeric_limits<T>::is_exact = false;
  956.  
  957. template <class T>
  958. const int numeric_limits<T>::radix = 0;
  959.  
  960. template <class T>
  961. const int numeric_limits<T>::min_exponent10 =0; 
  962.  
  963. template <class T>
  964. const int numeric_limits<T>::max_exponent10 = 0;
  965.  
  966. template <class T>
  967. const int numeric_limits<T>::min_exponent = 0;
  968.  
  969. template <class T>
  970. const int numeric_limits<T>::max_exponent = 0;
  971.  
  972. template <class T>
  973. const bool _RWSTDExportTemplate numeric_limits<T>::has_infinity = false;
  974.  
  975. template <class T>
  976. const bool numeric_limits<T>::has_quiet_NaN = false;
  977.  
  978. template <class T>
  979. const bool numeric_limits<T>::has_signaling_NaN = false;    
  980.  
  981. template <class T>
  982. const bool numeric_limits<T>::is_iec559 = false;
  983.  
  984. template <class T>
  985. const bool numeric_limits<T>::is_bounded = false;
  986.  
  987. template <class T>
  988. const bool numeric_limits<T>::is_modulo = false;
  989.  
  990. template <class T>
  991. const bool numeric_limits<T>::has_denorm = false;
  992.  
  993. template <class T>
  994. const bool numeric_limits<T>::has_denorm_loss = false;
  995.  
  996. template <class T>
  997. const bool numeric_limits<T>::traps = false;
  998.  
  999. template <class T>
  1000. const bool numeric_limits<T>::tinyness_before = false;
  1001.  
  1002. template <class T>
  1003. const float_round_style numeric_limits<T>::round_style = round_toward_zero;
  1004. #endif
  1005.  
  1006. #undef __RW_INIT
  1007.  
  1008. #ifndef _RWSTD_NO_NAMESPACE
  1009. }
  1010. #endif
  1011.  
  1012. #pragma option pop
  1013. #endif /*__STD_LIMITS*/
  1014.